﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;

namespace ASKM.Rachao.Model.Helper
{
    /// <summary>
    /// Mail helper class
    /// </summary>
    public static class EmailHelper
    {

        /// <summary>
        /// Sends an e-mail
        /// </summary>
        /// <param name="subject">E-mail's subject</param>
        /// <param name="body">Email's body</param>
        /// <param name="toName">Email's to name</param>
        /// <param name="toAddress">Email's to address</param>
        /// <param name="isHtml">Is Html?</param>
        public static void SendEmail(string subject, string body, string toName, string toAddress,bool isHtml)
        {            
            MailMessage mm = new MailMessage();
            mm.IsBodyHtml = isHtml;
            mm.Subject = subject;
            MailAddress ma = new MailAddress(toAddress, toName);
            mm.To.Add(ma);
            mm.Body = body;
            SmtpClient sc = new SmtpClient();
            sc.Send(mm);
        }

    }
}
